package cc.lison.tree;

public class BiTree {

	public String data;
	public BiTree left;
	public BiTree right;
	public BiTree() {
	}

	public BiTree(String data) {
		this.data = data;
	}

	public static void PreOrder(BiTree tree) {
		if (tree != null) {
			System.out.println(tree.data);
			PreOrder(tree.left);
			PreOrder(tree.right);
		}
	}

	public static void InOrder(BiTree tree) {
		if (tree != null) {
			InOrder(tree.left);
			System.out.println(tree.data);
			InOrder(tree.right);
		}
	}

	public static void PostOrder(BiTree tree) {
		if (tree != null) {
			PostOrder(tree.left);
			PostOrder(tree.right);
			System.out.println(tree.data);
		}
	}
}
